Integrand size = 23, antiderivative size = 74 \[ \int \cot (e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=-\frac {\sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a}}\right )}{f}+\frac {\sqrt {a-b} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a-b}}\right )}{f} \]
-arctanh((a+b*tan(f*x+e)^2)^(1/2)/a^(1/2))*a^(1/2)/f+arctanh((a+b*tan(f*x+ e)^2)^(1/2)/(a-b)^(1/2))*(a-b)^(1/2)/f
Time = 0.07 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.97 \[ \int \cot (e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=\frac {-\sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a}}\right )+\sqrt {a-b} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a-b}}\right )}{f} \]
(-(Sqrt[a]*ArcTanh[Sqrt[a + b*Tan[e + f*x]^2]/Sqrt[a]]) + Sqrt[a - b]*ArcT anh[Sqrt[a + b*Tan[e + f*x]^2]/Sqrt[a - b]])/f
Time = 0.28 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.03, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3042, 4153, 354, 94, 73, 221}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cot (e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sqrt {a+b \tan (e+f x)^2}}{\tan (e+f x)}dx\) |
\(\Big \downarrow \) 4153 |
\(\displaystyle \frac {\int \frac {\cot (e+f x) \sqrt {b \tan ^2(e+f x)+a}}{\tan ^2(e+f x)+1}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 354 |
\(\displaystyle \frac {\int \frac {\cot (e+f x) \sqrt {b \tan ^2(e+f x)+a}}{\tan ^2(e+f x)+1}d\tan ^2(e+f x)}{2 f}\) |
\(\Big \downarrow \) 94 |
\(\displaystyle \frac {a \int \frac {\cot (e+f x)}{\sqrt {b \tan ^2(e+f x)+a}}d\tan ^2(e+f x)-(a-b) \int \frac {1}{\left (\tan ^2(e+f x)+1\right ) \sqrt {b \tan ^2(e+f x)+a}}d\tan ^2(e+f x)}{2 f}\) |
\(\Big \downarrow \) 73 |
\(\displaystyle \frac {\frac {2 a \int \frac {1}{\frac {\tan ^4(e+f x)}{b}-\frac {a}{b}}d\sqrt {b \tan ^2(e+f x)+a}}{b}-\frac {2 (a-b) \int \frac {1}{\frac {\tan ^4(e+f x)}{b}-\frac {a}{b}+1}d\sqrt {b \tan ^2(e+f x)+a}}{b}}{2 f}\) |
\(\Big \downarrow \) 221 |
\(\displaystyle \frac {2 \sqrt {a-b} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a-b}}\right )-2 \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a}}\right )}{2 f}\) |
(-2*Sqrt[a]*ArcTanh[Sqrt[a + b*Tan[e + f*x]^2]/Sqrt[a]] + 2*Sqrt[a - b]*Ar cTanh[Sqrt[a + b*Tan[e + f*x]^2]/Sqrt[a - b]])/(2*f)
3.3.96.3.1 Defintions of rubi rules used
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[ {p = Denominator[m]}, Simp[p/b Subst[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] && Lt Q[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntL inearQ[a, b, c, d, m, n, x]
Int[((e_.) + (f_.)*(x_))^(p_)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_] :> Simp[(b*e - a*f)/(b*c - a*d) Int[(e + f*x)^(p - 1)/(a + b*x), x], x] - Simp[(d*e - c*f)/(b*c - a*d) Int[(e + f*x)^(p - 1)/(c + d*x), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && LtQ[0, p, 1]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x /Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_S ymbol] :> Simp[1/2 Subst[Int[x^((m - 1)/2)*(a + b*x)^p*(c + d*x)^q, x], x , x^2], x] /; FreeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && IntegerQ [(m - 1)/2]
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f) Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio nalQ[n]))
Leaf count of result is larger than twice the leaf count of optimal. \(583\) vs. \(2(62)=124\).
Time = 1.06 (sec) , antiderivative size = 584, normalized size of antiderivative = 7.89
method | result | size |
default | \(-\frac {\sqrt {a +b \tan \left (f x +e \right )^{2}}\, \left (-2 \ln \left (4 \cos \left (f x +e \right ) \sqrt {a -b}\, \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}+4 \cos \left (f x +e \right ) a -4 b \cos \left (f x +e \right )+4 \sqrt {a -b}\, \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}\right ) a^{\frac {3}{2}}+a \ln \left (-\frac {4 \left (\cos \left (f x +e \right ) \sqrt {a}\, \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}+\cos \left (f x +e \right ) a -b \cos \left (f x +e \right )+\sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}\, \sqrt {a}+b \right )}{\cos \left (f x +e \right )-1}\right ) \sqrt {a -b}+2 \ln \left (4 \cos \left (f x +e \right ) \sqrt {a -b}\, \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}+4 \cos \left (f x +e \right ) a -4 b \cos \left (f x +e \right )+4 \sqrt {a -b}\, \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}\right ) \sqrt {a}\, b -\ln \left (\frac {2 \cos \left (f x +e \right ) \sqrt {a}\, \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}+2 \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}\, \sqrt {a}-2 \cos \left (f x +e \right ) a +2 b \cos \left (f x +e \right )+2 b}{\sqrt {a}\, \left (\cos \left (f x +e \right )+1\right )}\right ) \sqrt {a -b}\, a \right ) \cos \left (f x +e \right )}{2 f \sqrt {a}\, \sqrt {a -b}\, \left (\cos \left (f x +e \right )+1\right ) \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}}\) | \(584\) |
-1/2/f/a^(1/2)/(a-b)^(1/2)*(a+b*tan(f*x+e)^2)^(1/2)*(-2*ln(4*cos(f*x+e)*(a -b)^(1/2)*((a*cos(f*x+e)^2-b*cos(f*x+e)^2+b)/(cos(f*x+e)+1)^2)^(1/2)+4*cos (f*x+e)*a-4*b*cos(f*x+e)+4*(a-b)^(1/2)*((a*cos(f*x+e)^2-b*cos(f*x+e)^2+b)/ (cos(f*x+e)+1)^2)^(1/2))*a^(3/2)+a*ln(-4*(cos(f*x+e)*a^(1/2)*((a*cos(f*x+e )^2-b*cos(f*x+e)^2+b)/(cos(f*x+e)+1)^2)^(1/2)+cos(f*x+e)*a-b*cos(f*x+e)+(( a*cos(f*x+e)^2-b*cos(f*x+e)^2+b)/(cos(f*x+e)+1)^2)^(1/2)*a^(1/2)+b)/(cos(f *x+e)-1))*(a-b)^(1/2)+2*ln(4*cos(f*x+e)*(a-b)^(1/2)*((a*cos(f*x+e)^2-b*cos (f*x+e)^2+b)/(cos(f*x+e)+1)^2)^(1/2)+4*cos(f*x+e)*a-4*b*cos(f*x+e)+4*(a-b) ^(1/2)*((a*cos(f*x+e)^2-b*cos(f*x+e)^2+b)/(cos(f*x+e)+1)^2)^(1/2))*a^(1/2) *b-ln(2/a^(1/2)*(cos(f*x+e)*a^(1/2)*((a*cos(f*x+e)^2-b*cos(f*x+e)^2+b)/(co s(f*x+e)+1)^2)^(1/2)+((a*cos(f*x+e)^2-b*cos(f*x+e)^2+b)/(cos(f*x+e)+1)^2)^ (1/2)*a^(1/2)-cos(f*x+e)*a+b*cos(f*x+e)+b)/(cos(f*x+e)+1))*(a-b)^(1/2)*a)* cos(f*x+e)/(cos(f*x+e)+1)/((a*cos(f*x+e)^2-b*cos(f*x+e)^2+b)/(cos(f*x+e)+1 )^2)^(1/2)
Time = 0.30 (sec) , antiderivative size = 382, normalized size of antiderivative = 5.16 \[ \int \cot (e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=\left [\frac {\sqrt {a - b} \log \left (\frac {b \tan \left (f x + e\right )^{2} + 2 \, \sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {a - b} + 2 \, a - b}{\tan \left (f x + e\right )^{2} + 1}\right ) + \sqrt {a} \log \left (\frac {b \tan \left (f x + e\right )^{2} - 2 \, \sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {a} + 2 \, a}{\tan \left (f x + e\right )^{2}}\right )}{2 \, f}, \frac {2 \, \sqrt {-a + b} \arctan \left (-\frac {\sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {-a + b}}{a - b}\right ) + \sqrt {a} \log \left (\frac {b \tan \left (f x + e\right )^{2} - 2 \, \sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {a} + 2 \, a}{\tan \left (f x + e\right )^{2}}\right )}{2 \, f}, \frac {2 \, \sqrt {-a} \arctan \left (\frac {\sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {-a}}{a}\right ) + \sqrt {a - b} \log \left (\frac {b \tan \left (f x + e\right )^{2} + 2 \, \sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {a - b} + 2 \, a - b}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, f}, \frac {\sqrt {-a} \arctan \left (\frac {\sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {-a}}{a}\right ) + \sqrt {-a + b} \arctan \left (-\frac {\sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {-a + b}}{a - b}\right )}{f}\right ] \]
[1/2*(sqrt(a - b)*log((b*tan(f*x + e)^2 + 2*sqrt(b*tan(f*x + e)^2 + a)*sqr t(a - b) + 2*a - b)/(tan(f*x + e)^2 + 1)) + sqrt(a)*log((b*tan(f*x + e)^2 - 2*sqrt(b*tan(f*x + e)^2 + a)*sqrt(a) + 2*a)/tan(f*x + e)^2))/f, 1/2*(2*s qrt(-a + b)*arctan(-sqrt(b*tan(f*x + e)^2 + a)*sqrt(-a + b)/(a - b)) + sqr t(a)*log((b*tan(f*x + e)^2 - 2*sqrt(b*tan(f*x + e)^2 + a)*sqrt(a) + 2*a)/t an(f*x + e)^2))/f, 1/2*(2*sqrt(-a)*arctan(sqrt(b*tan(f*x + e)^2 + a)*sqrt( -a)/a) + sqrt(a - b)*log((b*tan(f*x + e)^2 + 2*sqrt(b*tan(f*x + e)^2 + a)* sqrt(a - b) + 2*a - b)/(tan(f*x + e)^2 + 1)))/f, (sqrt(-a)*arctan(sqrt(b*t an(f*x + e)^2 + a)*sqrt(-a)/a) + sqrt(-a + b)*arctan(-sqrt(b*tan(f*x + e)^ 2 + a)*sqrt(-a + b)/(a - b)))/f]
\[ \int \cot (e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=\int \sqrt {a + b \tan ^{2}{\left (e + f x \right )}} \cot {\left (e + f x \right )}\, dx \]
Exception generated. \[ \int \cot (e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=\text {Exception raised: ValueError} \]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(b-a>0)', see `assume?` for more details)Is
Exception generated. \[ \int \cot (e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=\text {Exception raised: TypeError} \]
Exception raised: TypeError >> an error occurred running a Giac command:IN PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Error: Bad Argument Type
Time = 0.31 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.12 \[ \int \cot (e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=-\frac {\sqrt {a}\,\mathrm {atanh}\left (\frac {\sqrt {b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a}}{\sqrt {a}}\right )}{f}-\frac {\mathrm {atanh}\left (\frac {a\,b^3\,\sqrt {b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a}\,\sqrt {a-b}}{a\,b^4-a^2\,b^3}\right )\,\sqrt {a-b}}{f} \]